<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">

		<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
		<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
		<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
		 crossorigin="anonymous">
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
		 crossorigin="anonymous"> -->

		<link rel="stylesheet" type="text/css" href="../static/dist/css/bootstrap.css" />
	</head>
	<style type="text/css">
		#body {
			width: 100%;
			height: 100vh;
			display: flex;
			align-items: center;
			/* justify-content: center; */
			flex-direction: column;
			position: relative;
		}

		.icon img {
			margin-top: 100px;
			height: 80px;
		}

		.text {
			font-size: 32px;
			color: #39f;
			line-height: 180px;
			height: 120px;
		}

		.text2 {
			font-size: 20px;
			color: #555;
			margin: 40px 40px;
			line-height: 50px;
			text-align: center;
			letter-spacing: 0.5px;
		}
	</style>
	<body>
		<div id="body">
			<div class="icon">
				<img src="../static/img/icon3.png">
			</div>
			<div class="text">
				
			</div>
			<div class="text2">
				验证邮件已发送到您填写的邮箱中,请您登录邮箱按提示点击链接完成商户入驻. <a onclick="send_email()" class="btn btn-primary btn-sm" style="height: 28px; line-height:27px; padding:0 8px;">重新发送</a>
			</div>
		</div>
	</body>
	<script src="../static/js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		function getUrlParam(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null) return decodeURI(r[2]);
			return null;
		}

		function big_text() {
			var text = $(".text");
			text.animate({
				fontSize: '50'
			}, "0");
			setTimeout(function(){
				text.animate({
					fontSize: '32px'
				}, "0");
			},2500)
		}
		function send_email() {
			$(".text").text("邮件发送中···")
			$.ajax({
				type: "GET",
				url: "http://test.aimendian.cn/face/account/sendEmail",
				data: {
					email: getUrlParam("email")
				},
				success: function(resp) {
					console.log(resp)
					if (resp.code == 100) {
						setTimeout(function() {
							$(".text").text("邮件已发送成功")
						}, 1000)
					} else if (resp.code == 314) {
						big_text()
						$(".text").text("该邮箱已激活啦").css("color","green")
						setTimeout(function() {
							window.location.href = "http://47.93.205.45:8080/face/#/login?redirect=%2Fdashboard"
						},3200)
					} else {
						setTimeout(function() {
							$(".text").text("邮件发送失败").css("color","red")
						}, 1000)
					}
				},
				error: function(error) {
					setTimeout(function() {
						$(".text").text("邮件发送失败").css("color","red")
					}, 1000)
					console.log(resp)
				}
			}).responseJSON;
		}
		send_email()
	</script>

	<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
	<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
	<!-- <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>-->
	<script>

	</script>
</html>
